<%-- 
    Document   : User
    Created on : 14-08-2014, 11:00:59
    Author     : NGOCLINH-PC
--%>

<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Data.Member"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<div class="primarysanpham">
    <div class="menusanpham">
        <div class="menusanpham1">

        </div>
    </div>
    <div class="tablesanpham">
        <div class="tablesanpham1">
            <form action="" method="post" name="frm" id="frm">
                <!--<li style="list-style: none; padding: 10px;"><input style="width: 100px; height: 30px;" type="submit" name="btnxoa" value="Delete"/></li>-->
                <h2 style="padding: 10px; color: #999;">Management Customer</h2>
                <hr />
                <table width="100%" border="1" cellspacing="0" cellpadding="4" id="mytable">
                    <tr>
                        <th scope="col">STT</th>
                     
                        <th scope="col">Member Name</th>
                        <th scope="col">Username</th>
                        <th scope="col">Email</th>
                        <th scope="col">Phone</th>
                        <th scope="col">Gender</th>
                        <th scope="col">Address</th>
                        <th scope="col">Birthday</th>
                        <th scope="col">Date Create</th>
                        <th scope="col">Role</th>
                        <th scope="col">Status</th>
                        <th scope="col">Actions</th>
                    </tr>
                    <%
                        Member ct = new Member();
                        ArrayList<Member> p = ct.CustomerSelect();
                        int k = 1;
                        if (p.size() > 0) {
                            for (int i = 0; i < p.size(); i++) {
                                Member pay = p.get(i);

                                SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM/yyyy");

                                out.print("<tr>");
                                out.print("<td>" + k++ + "</td>");
                                //out.print("<td><input name='' type='checkbox' value='' /></td>");
                                out.print("<td>" + pay.getMemberName() + "</td>");
                                out.print("<td>" + pay.getUsername() + "</td>");
                                out.print("<td>" + pay.getEmail() + "</td>");
                                out.print("<td>" + pay.getPhone() + "</td>");
                                out.print("<td>" + pay.getGender() + "</td>");
                                out.print("<td>" + pay.getAddress() + "</td>");
                                out.print("<td>" + sdf.format(pay.getBirthday()) + "</td>");
                                out.print("<td>" + sdf.format(pay.getDateCreate()) + "</td>");
                                if (pay.getRoleID() == 1) {
                                    out.print("<td>Admin</td>");
                                } else if (pay.getRoleID() == 2) {
                                } else {
                                    out.print("<td>Customers</td>");
                                }
                                if (pay.getStatus() == 1) {
                                    out.print("<td><img src='../admin/image/check.png' alt='check' /></td>");
                                } else {
                                    out.print("<td><img src='../admin/image/No_check.png' alt='no_check' /></td>");
                                }
                                out.print("<td><span class='xoa'><a href='index.jsp?page=updateCustomer&EmemID=" + pay.getMemberID() + "'><img src='../admin/image/editBtn.gif' alt='editBtn'  /></a>&nbsp;<a href='../MemberPR?AmemID=" + pay.getMemberID() + "' onclick='return confirm(\"Do you want delete!\")'><img src='../admin/image/deleteBtn.gif' alt='deleteBtn' /></a></span></td>");
                                out.print("</tr>");
                            }
                        }%>
                </table>
                <div class="pages"></div>
            </form>
        </div>
    </div>
</div>
